package MyArray;

import java.util.Arrays;

/**实现数组拷贝(内容复制)
 * @author Raymond
 * @create 2025/2/26 10:59
 */
public class ArrayCopy {
    public static void main(String[] args) {
        int[] array = {1,2,3,4,5};
        int[] copy = new int[array.length];
        for (int i = 0; i < array.length; i++) {
            copy[i]=array[i];
        }
        array[0]=0;
        System.out.println("copy = " + Arrays.toString(copy));
    }
}
